package crawl;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class CrawlDemo1 {
    public static void main(String[] args)throws Exception {
        URL url = new URL("https://example.com");
        // 打开连接并创建输入流
        BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
        String line;
        StringBuilder content = new StringBuilder();

        while ((line = reader.readLine()) != null) {
            content.append(line);
        }
        reader.close();
        System.out.println(content);


    }
}
